@extends('admin.master')

    @section('css-header')
        @parent
        {{ HTML::style('assets/admin/css/bootstrap-wysihtml5.css') }}
    @stop


        @section('content')
        <h1>Crear <small>Objeto</small></h1>

        <!-- if there are creation errors, they will show here -->
        @if (Session::has('errors'))
        <div class="alert alert-danger">{{ HTML::ul($errors->all()) }}</div>
        @endif

        {{-- POST to admin/obtejos. The resource controller will handle this and 
            automatically route the request to the store() method. --}}

        {{ Form::open(['url' => 'admin/objetos', 'files' => true]) }}
        
        <div class="row">
            <div class="col-lg-6">
                <div class="form-group">
                    {{ Form::label('nombre', 'Nombre') }}
                    {{ Form::text('nombre', Input::old('nombre'), array('class' => 'form-control')) }}
                </div>
            </div>
            <div class="col-lg-2">
                <div class="form-group">
                    {{ Form::label('tags', 'Categoría') }}
                    {{ Form::select('tags', $tags, Input::old('tags'), ['class' => 'form-control']) }}

                    {{-- Multiple opciones --}}
                    {{-- Form::select('tags[]', $tags, Input::old('$tags'), ['class' => 'form-control', 'multiple']) --}}
                </div>
            </div>
            <div class="col-lg-2">
                <div class="form-group">
                    {{ Form::label('estado', 'Estado') }}<br>
                    {{-- Form::checkbox(name, value, checked) --}}
                    {{ Form::radio('estado', 1, Input::old('estado', true)) }} Publico
                    {{ Form::radio('estado', 0, Input::old('estado')) }} Privado
                </div>
            </div>
            <div class="col-lg-2">
                {{ Form::label('publicar', 'Publicar') }}<br>
                {{ Form::button('<span class="ladda-label">Crear</span>', ['type' => 'submit', 'class' => 'ladda-button btn btn-primary', 'data-style'=>'zoom-in']) }}
                {{-- Form::submit('Crear', array('class' => 'btn btn-primary')) --}}
                {{ HTML::link('admin/objetos', 'Cancelar', ['class' => 'btn btn-default']) }}
            </div>
        </div>
        
        
        <div class="row">
            <div class="col-lg-8">
                <div class="form-group">
                    {{ Form::label('descripcion', 'Descripcion') }}
                    {{ Form::textarea('descripcion', Input::old('descripcion'), ['class' => 'form-control', 'id' => 'wysiwyg-textarea']) }}
                </div>
                <div class="form-group">
                    {{ Form::label('link_name', 'Link nombre') }}
                    {{ Form::text('link_name', Input::old('link_name'), array('class' => 'form-control')) }}
                </div>
                <div class="form-group">
                    {{ Form::label('link', 'Link') }}
                    {{ Form::text('link', Input::old('link'), array('class' => 'form-control', 'placeholder' => 'http://')) }}
                </div>
            </div>
            <div class="col-lg-4">
                {{ Form::label('image', 'Agregar im&aacute;genes (jpeg)') }}
                <div class="form-group panel panel-default">
                    <div class="panel-body">
                        @include('admin.imagenes.uploadImagen')
                    </div>
                </div>
            </div>
        </div>
        {{ Form::close() }}
@stop

@section('js-footer')
    @parent
    {{ HTML::script('assets/admin/js/wysihtml5-0.3.0.min.js') }}
    {{ HTML::script('assets/admin/js/bootstrap3-wysihtml5.js') }}
    {{ HTML::script('assets/admin/js/jquery.preimage.js') }}
    {{ HTML::script('assets/admin/js/scripts.js') }}
@stop
